package me.thinkjet.controller;

import me.thinkjet.model.Users;
import me.thinkjet.utils.RandomUtils;
import me.thinkjet.validator.RegisterValidator;

import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.ext.route.ControllerBind;

/**
 * RegisterController
 */
@ControllerBind(controllerKey = "/register", viewPath = "register")
public class RegisterController extends Controller {
	public void index() {
		this.render("index.jsp");
	}

	@Before(RegisterValidator.class)
	public void vertify() {
		System.out.print("dfasda");
		getModel(Users.class).put("verified", 0).put("vertify", RandomUtils.getRandomString(60)).save();
		this.render("check.jsp");
		System.out.print("dfasda");
	}

	public void pass() {

	}

}
